﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="cart.aspx.cs" Inherits="cart" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table align="center" border="1" style="width: 95%;">
        <tr>
            <td colspan="5" style="text-align: center; height: 28px; color: #0000FF">
                <b style="font-size: large; color: #FF0000">Chi tiết giỏ hàng</b></td>
        </tr>
        <tr>
            <td style="text-align: center; color: #0000FF; width: 210px">
                <b>Tên sản phẩm</b></td>
            <td style="text-align: center; color: #0000FF; width: 95px;">
                <b>Số lượng</b></td>
            <td style="text-align: center">
                <b style="color: #0000FF">Đơn giá</b></td>
            <td style="text-align: center">
                <b style="color: #0000FF">Thành tiền </b>
            </td>
            <td style="text-align: center">
                <b style="color: #0000FF">Xóa</b></td>
        </tr>
        

        <asp:Repeater ID="CartItems" runat="server" onitemcommand="CartItems_ItemCommand">
        <ItemTemplate>
        <tr style="color: #000000">
            <td style="width: 210px; text-align: center">
                <b><%# Eval("name") %></b></td>
            <td style="text-align: center">
                <b>
                <asp:TextBox ID="ItemId" Text='<%# Session["item" + Eval("id")]%>' size="2" runat="server"></asp:TextBox>   	
                                        <asp:ImageButton ID="ImageButton1" title="Cập nhật số lượng" CommandName="addQuanlity" CommandArgument='<%# Eval("id") %>' ImageUrl="~/images/button_update_cart.gif" runat="server" />
                </b>
            </td>
            <td style="text-align: center">
                <b><%# Eval("price", "{0:0,0}") %> VNĐ</b></td>
            <td style="text-align: center">
                <b><%# string.Format("{0:0,0}",getSumCash(Eval("id").ToString())) %> VNĐ</b></td>
            <td style="text-align: center">
                <b><asp:ImageButton ID="ImageButton2" CommandName="delItem" CommandArgument='<%# Eval("id") %>' title="Xoá sản phẩm khỏi giỏ hàng" ImageUrl="images/delete.gif" OnClientClick="return deleteFromCart();" runat="server" />      </b></td>

                </tr>
                </ItemTemplate>
                </asp:Repeater>
        

        <tr>
            <td style="width: 210px; text-align: right; height: 22px">
                <b style="color: #0000FF">Tổng tiền =&nbsp;&nbsp; </b></td>
            <td colspan="4" style="height: 22px; text-align: center;">
                <b><span class="style1"><% Response.Write(string.Format("{0:0,0}", getTotalCash())); %>&nbsp;VNĐ</span></b></td>
        </tr>
    </table>
    <br />
    <div style="text-align: center">
        <a href="Default.aspx"><input id="Button1" style="height: 38px" type="button" 
                    value="Về trang chủ" /></a>&nbsp;
        <asp:Button ID="btnDelCart" runat="server" Height="38px" 
            onclientclick="return deleteCart();" 
            Text="Xóa giỏ hàng" onclick="btnDelCart_Click" />
&nbsp;
        <asp:Button ID="btnCheckout" runat="server" Height="38px" 
             Text="Thanh toán" onclick="btnCheckout_Click" />

        
        </div>
    
    
    </asp:Content>

